import httpInstance from "@/utils/http.js";


//查询专家信息
export function getExpertInfoAPI(uid){
    return httpInstance({
        url:`/expert/expertInfo/${uid}`,
        method:'get',
    })
}

//申请成为专家
export function applyExpertAPI(expert){
    return httpInstance({
        url:'/expert/BeExpert',
        method:'post',
        data:expert
    })
}


//发布问答帖子
export function putQuestionAPI(question){
    return httpInstance({
        url:'/expert/QsCreation',
        method:'post',
        data:question,
    })
}

//获取问答帖子详情
export function getQuestionDetailAPI(qid){
    return httpInstance({
        url:'/expert/Question',
        method:'get',
        params:{
            qid:qid
        }
    })
}

//回复帖子
export function replyQuestionAPI(data){
    return httpInstance({
        url:'/expert/answer',
        method:'post',
        params:{
            qid:data.qid,
            answer:data.answer
        }
    })
}

//获取指定uid回复过的问答贴子
export function getQuestionsByUidAPI(uid){
    return httpInstance({
        url:`/expert/expertQuestion/${uid}`,
        method:'get',
    })
}

//回复帖子
export function replyMoreQuestionAPI(data){
    return httpInstance({
        url:'/expert/moreAnswer',
        method:'post',
        params:{
            qid:data.qid,
            uid:data.uid,
            answer:data.answer
        }
    })
}

//查询所有帖子
export function getAllQuesAPI(){
    return httpInstance({
        url:'/expert/ListAllQuestion',
        method:'get',

    })
}
//获取帖子下所有回复
export function getAllCommentsAPI(qid){
    return httpInstance({
        url:'/expert/getMoreAnswer',
        method:'get',
        params:{
            qid:qid
        }
    })
}

